package com.tj.collection.controller.lending.response;

import com.fqgj.common.api.ResponseData;
import com.tj.collection.db.domain.Admin;
import com.tj.collection.service.dto.ClAgentsVo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2019/9/6
 * Time: 下午5:08
 */
public class CollectionAgentResponse implements ResponseData {

    private List<AgentItem> agentList;

    public CollectionAgentResponse(List<ClAgentsVo> clAgentsVoList, Map<Integer, Admin> adminIdAndMobileMap) {
        this.agentList = new ArrayList<>();
        for (ClAgentsVo clAgentsVo : clAgentsVoList) {
            Admin admin = adminIdAndMobileMap.get(clAgentsVo.getAdminId());
            AgentItem agentItem = new AgentItem();
            agentItem.setAdminId(clAgentsVo.getAdminId() + "");
            agentItem.setAdminName(clAgentsVo.getName());
            agentItem.setBucket(clAgentsVo.getStageName());
            agentItem.setMaxOrdersNum(clAgentsVo.getMaxOrdersNum());
            agentItem.setMinOrdersNum(clAgentsVo.getMinOrdersNum());
            agentItem.setStatus(clAgentsVo.getStatus() + "");
            agentItem.setUserLanguageList(clAgentsVo.getUserLanguageList());
            agentItem.setMobile(admin.getMobile());
            agentItem.setAccount(admin.getAccount());
            this.agentList.add(agentItem);
        }
    }

    public static class AgentItem {
        private String adminId;
        private String account;
        private String adminName;
        private String bucket;
        private List<String> userLanguageList;
        private Integer maxOrdersNum;
        private Integer minOrdersNum;
        private String status;
        private String mobile;

        public String getMobile() {
            return mobile;
        }

        public AgentItem setMobile(String mobile) {
            this.mobile = mobile;
            return this;
        }

        public String getAdminId() {
            return adminId;
        }

        public AgentItem setAdminId(String adminId) {
            this.adminId = adminId;
            return this;
        }

        public String getAccount() {
            return account;
        }

        public AgentItem setAccount(String account) {
            this.account = account;
            return this;
        }

        public String getAdminName() {
            return adminName;
        }

        public AgentItem setAdminName(String adminName) {
            this.adminName = adminName;
            return this;
        }

        public String getBucket() {
            return bucket;
        }

        public AgentItem setBucket(String bucket) {
            this.bucket = bucket;
            return this;
        }

        public List<String> getUserLanguageList() {
            return userLanguageList;
        }

        public AgentItem setUserLanguageList(List<String> userLanguageList) {
            this.userLanguageList = userLanguageList;
            return this;
        }

        public Integer getMaxOrdersNum() {
            return maxOrdersNum;
        }

        public AgentItem setMaxOrdersNum(Integer maxOrdersNum) {
            this.maxOrdersNum = maxOrdersNum;
            return this;
        }

        public Integer getMinOrdersNum() {
            return minOrdersNum;
        }

        public AgentItem setMinOrdersNum(Integer minOrdersNum) {
            this.minOrdersNum = minOrdersNum;
            return this;
        }

        public String getStatus() {
            return status;
        }

        public AgentItem setStatus(String status) {
            this.status = status;
            return this;
        }
    }
}
